= form_for(@admin, url: url, html: { class: 'form-horizontal' }) do |f|
  = render partial: 'shared/cpanel/error_messages', locals: { object: @admin }
  .form-group
    = f.label :email, class: 'control-label col-md-2 no-padding-right'
    .col-md-8
      = f.email_field :email, class: 'form-control'
  .form-group
    = f.label :name, class: 'control-label col-md-2 no-padding-right'
    .col-md-8
      = f.text_field :name, class: 'form-control'
  .form-group
    = f.label :roles, class: 'control-label col-md-2 no-padding-right'
    .col-md-8.checkbox
      - AnAnCommon.resources.each do |role_name, role_description|
        %label
          = check_box_tag 'admin[roles][]', role_name, @admin.has_role?(role_name)
          = role_description
  .form-group
    .col-md-offset-2
      = f.submit '提交', class: 'btn btn-primary btn-outline', data: { disable_with: '请稍候...' }

